<%--
  Created by IntelliJ IDEA.
  User: 云哥
  Date: 2023-05-19
  Time: 14:58
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    //服务端
    //1.处理字符集乱码，post请求中文会出现乱码
    request.setCharacterEncoding("UTF-8");
    //2.获取客户端表单的信息？(form元素的 name属性)
    String username = request.getParameter("username");
    String password = request.getParameter("password");
    String sex = request.getParameter("sex");
    String identity = request.getParameter("identity");
    //String hobby = request.getParameter("hobby");//只能获取一个复选框的值
    String[] hobbyArray= request.getParameterValues("hobby");//获取多个复选框的值
    //2.将数据保存到数据库
    //out.print("<script>alert('注册成功！！！')</script>");

%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户注册信息</title>
</head>
<body>
<h1>用户信息</h1>
<%--//2.展示用户注册的信息--%>
<h4>用户名：<%=username%></h4>
<h4>密码：<%=password%></h4>
<h4>性别：<%=sex%></h4>
<h4>身份：<%=identity%></h4>
<h5>爱好：</h5>
<%for (String s : hobbyArray) {
       out.print(s+"&nbsp;&nbsp;");
    }%>
</body>
</html>